﻿#include "GUI.h"
#include "DIALOG.h"
#include "CreateWidget.h"
#include "AppFunction.h"
#include "common_path.h"


 PARA_TCB music_widget[15];

void music_widget_create(WM_HWIN hParent){

	music_widget[0].guiTCB.winType = WIDGET_WINDOW;
	music_widget[0].guiTCB.xPos = 0;
	music_widget[0].guiTCB.yPos = 0;
	music_widget[0].guiTCB.xSize = 720;
	music_widget[0].guiTCB.ySize = 720;
	music_widget[0].appTCB.funType = GROUP_CONTROL;
	music_widget[0].guiTCB.pRedraw = draw_line;
	music_widget[0].appTCB.addrList = 0;
	music_widget[0].guiTCB.id = GetUniqueID();
	music_widget[0].pPreviousLayer = NULL;
	music_widget[0].pNextLayer = NULL;
	music_widget[0].pParallelNext = &music_widget[1];
	music_widget[0].parent = 0;
	music_widget[0].winLayer = 2;
	music_widget[0].transparency = 1;
	SetPictureHmem(&music_widget[0], 0, 0, GetPicturePathHmem(I_DTA_PATH_BGHOME));


	music_widget[1].guiTCB.winType = WIDGET_STATIC_TEXT;
	AddStringToBuffer(music_widget[1].guiTCB.winName, "我有一头小毛驴");
	music_widget[1].guiTCB.xPos = 260;
	music_widget[1].guiTCB.yPos = 40;
	music_widget[1].guiTCB.xSize = 200;
	music_widget[1].guiTCB.ySize = 40;
	music_widget[1].appTCB.funType = SWITCH_ACTUATOR;
	music_widget[1].appTCB.addrList = 0;
	music_widget[1].guiTCB.id = GetUniqueID();
	music_widget[1].pPreviousLayer = NULL;
	music_widget[1].pNextLayer = NULL;
	music_widget[1].pParallelNext = &music_widget[2];
	music_widget[1].parent = NULL;


	music_widget[2].guiTCB.winType = WIDGET_BUTTON,
	music_widget[2].guiTCB.xPos = 590,
	music_widget[2].guiTCB.yPos = 30,
	music_widget[2].guiTCB.xSize = 120,
	music_widget[2].guiTCB.ySize = 120,
	music_widget[2].appTCB.funType = SWITCH_ACTUATOR,
	music_widget[2].appTCB.addrList = 0;
	music_widget[2].guiTCB.id = GetUniqueID();
	music_widget[2].pPreviousLayer = NULL;
	music_widget[2].pNextLayer = NULL;
	music_widget[2].pParallelNext = &music_widget[3];
	music_widget[2].parent = NULL;
	sprintf(music_widget[2].guiTCB.onPath, "%s", DTA_MUSIC_RANDOM);
	sprintf(music_widget[2].guiTCB.offPath, "%s", DTA_MUSIC_CIRCULATE);



	music_widget[3].guiTCB.winType = WIDGET_PROGBAR;
	AddStringToBuffer(music_widget[3].guiTCB.winName, "播放进度");
	//strcat(music_widget[3].guiTCB.winName, "播放进度");
	music_widget[3].guiTCB.xPos = 80,
	music_widget[3].guiTCB.yPos = 210,
	music_widget[3].guiTCB.xSize = 560,
	music_widget[3].guiTCB.ySize = 10,
	music_widget[3].appTCB.funType = SWITCH_ACTUATOR,
	music_widget[3].appTCB.addrList = 0;
	music_widget[3].guiTCB.id = GetUniqueID();
	music_widget[3].pPreviousLayer = NULL;
	music_widget[3].pNextLayer = NULL;
	music_widget[3].pParallelNext = &music_widget[4];
	music_widget[3].parent = NULL;


	music_widget[4].guiTCB.winType = WIDGET_STATIC_TEXT;
	AddStringToBuffer(music_widget[4].guiTCB.winName, "00:00");
	music_widget[4].guiTCB.xPos = 50,
	music_widget[4].guiTCB.yPos = 230,
	music_widget[4].guiTCB.xSize = 100,
	music_widget[4].guiTCB.ySize = 40,
	music_widget[4].appTCB.funType = JUMP_TO_WINDOW,
	music_widget[4].appTCB.addrList = 0;
	music_widget[4].guiTCB.id = GetUniqueID();
	music_widget[4].pPreviousLayer = NULL;
	music_widget[4].pNextLayer = NULL;
	music_widget[4].pParallelNext = &music_widget[5];
	music_widget[4].parent = NULL;


	music_widget[5].guiTCB.winType = WIDGET_STATIC_TEXT;
	AddStringToBuffer(music_widget[5].guiTCB.winName, "05:22");
	music_widget[5].guiTCB.xPos = 580,
	music_widget[5].guiTCB.yPos = 230,
	music_widget[5].guiTCB.xSize = 100,
	music_widget[5].guiTCB.ySize = 40,
	music_widget[5].appTCB.funType = SWITCH_ACTUATOR,
	music_widget[5].appTCB.addrList = 0;
	music_widget[5].guiTCB.id = GetUniqueID();
	music_widget[5].pPreviousLayer = NULL;
	music_widget[5].pNextLayer = NULL;
	music_widget[5].pParallelNext = &music_widget[6];
	music_widget[5].parent = NULL;



	music_widget[6].guiTCB.winType = WIDGET_BUTTON,
	strcat(music_widget[6].guiTCB.winName, "");
	music_widget[6].guiTCB.xPos = 72,
	music_widget[6].guiTCB.yPos = 360,
	music_widget[6].guiTCB.xSize = 120,
	music_widget[6].guiTCB.ySize = 120,
	music_widget[6].appTCB.funType = SWITCH_ACTUATOR,
	music_widget[6].appTCB.addrList = 0;
	music_widget[6].guiTCB.id = GetUniqueID();
	music_widget[6].pPreviousLayer = NULL;
	music_widget[6].pNextLayer = NULL;
	music_widget[6].pParallelNext = &music_widget[7];
	music_widget[6].parent = NULL;
	sprintf(music_widget[6].guiTCB.onPath, "%s", DTA_MUSIC_PRE);
	sprintf(music_widget[6].guiTCB.offPath, "%s", DTA_MUSIC_PRE);





	music_widget[7].guiTCB.winType = WIDGET_BUTTON,
	strcat(music_widget[7].guiTCB.winName, "");
	music_widget[7].guiTCB.xPos = 0,
	music_widget[7].guiTCB.yPos = 20,
	music_widget[7].guiTCB.xSize = 120,
	music_widget[7].guiTCB.ySize = 120,
	music_widget[7].appTCB.funType = RETURN_FUNCTION,
	music_widget[7].appTCB.addrList = 0;
	music_widget[7].guiTCB.id = GetUniqueID();
	music_widget[7].pPreviousLayer = NULL;
	music_widget[7].pNextLayer = NULL;
	music_widget[7].pParallelNext = &music_widget[8];
	music_widget[7].parent = NULL;
	sprintf(music_widget[7].guiTCB.onPath, "%s", RETURN);
	sprintf(music_widget[7].guiTCB.offPath, "%s", RETURN);





	music_widget[8].guiTCB.winType = WIDGET_BUTTON,
	strcat(music_widget[8].guiTCB.winName, "");
	music_widget[8].guiTCB.xPos = 520,
	music_widget[8].guiTCB.yPos = 360,
	music_widget[8].guiTCB.xSize = 120,
	music_widget[8].guiTCB.ySize = 120,
	music_widget[8].appTCB.funType = SWITCH_ACTUATOR,
	music_widget[8].appTCB.addrList = 0;
	music_widget[8].guiTCB.id = GetUniqueID();
	music_widget[8].pPreviousLayer = NULL;
	music_widget[8].pNextLayer = NULL;
	music_widget[8].pParallelNext = &music_widget[9];
	music_widget[8].parent = NULL;
	sprintf(music_widget[8].guiTCB.onPath, "%s", DTA_MUSIC_NEXT);
	sprintf(music_widget[8].guiTCB.offPath, "%s", DTA_MUSIC_NEXT);


	music_widget[9].guiTCB.winType = WIDGET_BUTTON,
	strcat(music_widget[9].guiTCB.winName, "");
	music_widget[9].guiTCB.xPos = 270,
	music_widget[9].guiTCB.yPos = 310,
	music_widget[9].guiTCB.xSize = 171,
	music_widget[9].guiTCB.ySize = 171,
	music_widget[9].appTCB.funType = SWITCH_ACTUATOR,
	music_widget[9].appTCB.addrList = 0;
	music_widget[9].guiTCB.id = GetUniqueID();
	music_widget[9].pPreviousLayer = NULL;
	music_widget[9].pNextLayer = NULL;
	music_widget[9].pParallelNext = &music_widget[10];
	music_widget[9].parent = NULL;
	sprintf(music_widget[9].guiTCB.onPath, "%s", DTA_CURTAIN_PAUSE);
	sprintf(music_widget[9].guiTCB.offPath, "%s", DTA_CURTAIN_CONTINUE);



	music_widget[10].guiTCB.winType = WIDGET_SLIDE;
	AddStringToBuffer(music_widget[10].guiTCB.winName, "音量");
	//strcat(music_widget[10].guiTCB.winName, "音量");
	music_widget[10].guiTCB.xPos = 110,
	music_widget[10].guiTCB.yPos = 570,
	music_widget[10].guiTCB.xSize = 500,
	music_widget[10].guiTCB.ySize = 40,
	music_widget[10].appTCB.funType = SWITCH_ACTUATOR,
	music_widget[10].appTCB.addrList = 0;
	music_widget[10].guiTCB.id = GetUniqueID();
	music_widget[10].pPreviousLayer = NULL;
	music_widget[10].pNextLayer = NULL;
	music_widget[10].pParallelNext = &music_widget[11];
	music_widget[10].parent = NULL;




	music_widget[11].guiTCB.winType = WIDGET_BUTTON,
		strcat(music_widget[11].guiTCB.winName, "");

	music_widget[11].guiTCB.xPos = 80,
	music_widget[11].guiTCB.yPos = 580,
	music_widget[11].guiTCB.xSize = 25,
	music_widget[11].guiTCB.ySize = 25,
	music_widget[11].appTCB.funType = SWITCH_ACTUATOR,
	music_widget[11].appTCB.addrList = 0;
	music_widget[11].guiTCB.id = GetUniqueID();
	music_widget[11].pPreviousLayer = NULL;
	music_widget[11].pNextLayer = NULL;
	music_widget[11].pParallelNext = &music_widget[12];
	music_widget[11].parent = NULL;
	sprintf(music_widget[11].guiTCB.onPath, "%s", DTA_MUSIC_VOLUMEDOWN);
	sprintf(music_widget[11].guiTCB.offPath, "%s", DTA_MUSIC_VOLUMEDOWN);


	music_widget[12].guiTCB.winType = WIDGET_BUTTON;
	strcat(music_widget[12].guiTCB.winName, "");
	music_widget[12].guiTCB.xPos = 620;
	music_widget[12].guiTCB.yPos = 580;
	music_widget[12].guiTCB.xSize = 25;
	music_widget[12].guiTCB.ySize = 25;
	music_widget[12].appTCB.funType = IO_BUTTON_SENSOR;
	music_widget[12].appTCB.addrList = 0;
	music_widget[12].guiTCB.id = GetUniqueID();
	music_widget[12].pPreviousLayer = NULL;
	music_widget[12].pNextLayer = NULL;
	music_widget[12].pParallelNext = NULL;
	music_widget[12].parent = NULL;
	sprintf(music_widget[12].guiTCB.onPath, "%s", DTA_MUSIC_VOLUMEUP);
	sprintf(music_widget[12].guiTCB.offPath, "%s", DTA_MUSIC_VOLUMEUP);

	Concatenate(music_widget, 13, 2);
	CreateWidget(&music_widget[0], WM_HBKWIN, 0);

}


